//引入mongoose模块
let mongoose = require('mongoose');
//创建目标集合的模型对象
let studentSchema = new mongoose.Schema({
    name: String,
    classId: {
        type: mongoose.SchemaTypes.ObiectId,
        ref: 'classModel'
    },
    courseId: {
        type: mongoose.SchemaTypes.ObiectId,
        ref: 'courseModel'
    }
});
//建立模型队形与数据库中数据集合的关联关系
let studentseModel = mongoose.model('studentseModel', studentSchema, 'student');